namespace Brjnk.Common
{
    using System;
    using System.ComponentModel;

    /// <summary>
    /// </summary>
    public class GenericGroupDescription : GroupDescription
    {
        private Func<object, object> getNameFunc;

        public GenericGroupDescription(Func<object, object> getNameFunc)
        {
            this.getNameFunc = getNameFunc;
        }

        public override object GroupNameFromItem(object item, int level, System.Globalization.CultureInfo culture)
        {
            return getNameFunc(item);
        }
    }
}